﻿<DemoContainer>
    <ApexChart TItem="Order"
               Title="Order Net Value"
               XAxisType=XAxisType.Numeric
               Options=options>

        <ApexPointSeries TItem="Order"
                    Items="Orders"
                    Name="Gross Value"
                    SeriesType="SeriesType.Bar"
                    XValue="@(e => e.DiscountPercentage)"
                    YAggregate="@(e => e.Sum(e => e.GrossValue))"
                    OrderByDescending="e=>e.Y" />


    </ApexChart>
</DemoContainer>

@code {
    private List<Order> Orders { get; set; } = SampleData.GetOrders();
    private ApexChartOptions<Order> options { get; set; }

    protected override void OnInitialized()
    {
        base.OnInitialized();
        options = new ApexChartOptions<Order>
            {
                Xaxis = new XAxis { DecimalsInFloat = 1 }
            };
    }
}